import 'package:flutter/material.dart';

/**
 * @author hanson
 * @version[创立日期，2023/9/8 16:44]
 * @function[功用简介 ]
 **/
//https://blog.csdn.net/juer2017/article/details/131551152
class cartViewPage extends StatefulWidget {
  const cartViewPage({Key? key}) : super(key: key);

  @override
  _cartViewPageState createState() => _cartViewPageState();
}

class _cartViewPageState extends State<cartViewPage> {
  @override
  Widget build(BuildContext context) {
   /* return Scaffold(
        appBar: AppBar(
          title: Text("cartView"),
        ),
        body: Center(
          child: Column(),
        ) // This trailing comma makes auto-formatting nicer for build methods.
    );*/
    return ListView(

    );
  }
}

List<Widget> _initCardData() {
  var tempList = listData.map((value) {
    //卡片控件
    return Card(
      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), //圆角大小
      elevation: 10, //阴影深度
      margin: const EdgeInsets.all(10),//四周间距
      child: Column(
        children: [
          AspectRatio(
            aspectRatio: 16 / 9,//屏幕比例
            child: Image.network(value["imageUrl"], fit: BoxFit.cover),
          ),
          ListTile(
            //ClipOval实现圆角图片设置
            /*leading: ClipOval(
                child: Image.network(
                  value["imageUrl"],
                  fit: BoxFit.cover,
                  width: 40,
                  height: 40,
                ),
              ),*/
            //CircleAvatar实现圆角图片设置
            leading: CircleAvatar(
              backgroundImage: NetworkImage(value["imageUrl"]),
            ),
            title: Text(value["title"]),
            subtitle: Text(value["author"]),
          ),
        ],
      ),
    );
  });
  return tempList.toList();
}




  List listData = [
    {
      "title": "图一",
      "author": "程序员",
      "imageUrl": "https://www.itying.com/images/flutter/1.png",
    },
    {
      "title": "图二",
      "author": "程序员",
      "imageUrl": "https://www.itying.com/images/flutter/2.png",
    },
    {
      "title": "图三",
      "author": "程序员",
      "imageUrl": "https://www.itying.com/images/flutter/3.png",
    },
    {
      "title": "图四",
      "author": "程序员",
      "imageUrl": "https://www.itying.com/images/flutter/4.png",
    },
    {
      "title": "图五",
      "author": "程序员",
      "imageUrl": "https://www.itying.com/images/flutter/5.png",
    },
    {
      "title": "图六",
      "author": "程序员",
      "imageUrl": "https://www.itying.com/images/flutter/6.png",
    },
  ];
